-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add build concurrency control (fix #1819) #2953
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you address the comment and update the documentation?
Hello, @troyeagle first congrats by this job, its really cool. I'm trying to optimize this flow or trying understand better. I don't know if do you remember but, on my tests, the memory is never cleanuped while the loop run. using max-concurrency 5 for try: the memory growth slow but never go back My tests there are around this place: Thanks for your attention, if you have some idea to share with me, will be great. |
As I remember, what magic happens may be in the method The server-renderer may be stateful, it not just accepts an object and uses template to parse it, but run with a context and then create a bunch of async rendering tasks. The context may expand during the rendering process to save building cache for optimizing following tasks' rendering performance. I think it's not the results' not being GC-ed but the context growing that causes your memory growing. It seems vuepress always uses one context, when a group of tasks ends, just some of the spaces are set free. @sr2ds You could check whether the total size of 5 pages' html output string is the same as your memory growth per time, or use In all, the memory problem is the tradeoff of server-side rendering optimization. Vuepress maybe did not expect such huge size of pages, and in |
Thanks so much for your time and answer. To be honest I don't know how do a good review on inspect mode, but looks that the I made some tests but without success yet. I saw this other issue with some comparatives between vuepress and vitepress, I'll try a little bit more but looks more prudent to migrate to |
Summary
What kind of change does this PR introduce? (check at least one)
If changing the UI of default theme, please provide the before/after screenshot:
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #xxx[,#xxx]
, where "xxx" is the issue number)You have tested in the following browsers: (Providing a detailed version will be better.)
This PR is all about build phase. No need to check browser compability.
If adding a new feature, the PR's description includes:
To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
Other information:
To fix #1819. Vuepress build would fail for many docs, for Promise.all push thousands of files to VueServer to render concurrently and cause OOM.
#2454 tried to fix this problem. However, with pLimit fixed to 50, the build process may be significantly slowed down. To fix this, this PR makes it optional as a
vuepress build
param.